package com.luweijie.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.luweijie.entity.ShzwActivity;
import com.luweijie.entity.po.ShzwActivityPo;
import com.luweijie.mapper.ShzwActivityMapper;
import com.luweijie.service.IShzwActivityService;
import com.luweijie.util.POJOConverter;
import lombok.Data;
import org.aspectj.weaver.ast.Var;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 优惠券信息及规则表 服务实现类
 * </p>
 *
 * @author luweijie
 * @since 2020-06-03
 */
@Service

public class ShzwActivityServiceImpl extends ServiceImpl<ShzwActivityMapper, ShzwActivityPo> implements IShzwActivityService {
         @Autowired
         ShzwActivityMapper shzwActivityMapper;

       private   String s;



    /***
     * 根据不同状态查询活动
     * @param status 活动的状态
     * @param page 分页查询参数
     */


    @Override
    public IPage<ShzwActivityPo> query(Page page,String status) {
        QueryWrapper<ShzwActivityPo> queryWrapper = new QueryWrapper<>();

        queryWrapper.eq(status,"status");
        return shzwActivityMapper.selectPage(page, queryWrapper);
    }

    @Override
    public boolean add(ShzwActivityPo shzwActivityPo) {
        int insert = shzwActivityMapper.insert(shzwActivityPo);
         System.setProperty("ss",s)  ;
        return true;
    }

    @Override
    public boolean updata(ShzwActivityPo shzwActivityPo) {
        return this.updateById(shzwActivityPo);

    }

    public ShzwActivityPo a(int id) {

        ShzwActivityPo a = shzwActivityMapper.a(id);
        return a;
    }
}
